home *** CD-ROM | disk | FTP | other *** search
Text File | 1996-08-16 | 9.1 KB | 283 lines | [TEXT/MPS ] |
- //========================================================================================
- //
- // File: FWPresen.h
- // Release Version: $ ODF 1 $
- //
- // Copyright: (c) 1993 - 1996 by Apple Computer, Inc., all rights reserved.
- //
- //========================================================================================
-
- #ifndef FWPRESEN_H
- #define FWPRESEN_H
-
- #ifndef FWTCOLL_H
- #include "FWTColl.h"
- #endif
-
- #ifndef FWPART_H
- #include "FWPart.h"
- #endif
-
- // ----- OS Layer -----
-
- #ifndef FWRECT_H
- #include "FWRect.h"
- #endif
-
- // ----- Foundation Includes -----
-
- #ifndef FWRUNTYP_H
- #include "FWRunTyp.h"
- #endif
-
- #ifndef FWTCOLL_H
- #include "FWTColl.h"
- #endif
-
- // ----- OpenDoc -----
-
- #ifndef FWODTYPS_H
- #include "FWODTyps.h"
- #endif
-
- //========================================================================================
- // Forward Declarations
- //========================================================================================
-
- class ODArbitrator;
- class ODShape;
- class ODPart;
- class ODFrame;
- class ODFacet;
- class ODFocusSet;
-
- class FW_CSelection;
- class FW_CFrame;
- class FW_MProxy;
- class FW_CViewAs;
-
- //========================================================================================
- // class FW_CPrivDisplayFrame
- //========================================================================================
-
- class FW_CPrivDisplayFrame
- {
- public:
- FW_CPrivDisplayFrame(Environment *ev, FW_CFrame* frame);
- FW_CPrivDisplayFrame(Environment *ev, ODID frameID);
- ~FW_CPrivDisplayFrame();
-
- void Release(Environment *ev);
-
- ODID fFrameID;
- ODFrame* fODFrame;
- FW_CFrame* fFrame;
- };
-
- //========================================================================================
- // class FW_CPresentation
- //========================================================================================
-
- class FW_CPresentation
- {
- public:
- friend class FW_CPresentationFrameIterator;
-
- //----------------------------------------------------------------------------------------
- // Constructors/Destructors
- //
- public:
- FW_CPresentation(Environment *ev,
- FW_CPart* thePart,
- FW_CSelection* selection,
- ODTypeToken presentationType,
- ODTypeToken defaultEmbeddedFrameViewType = FW_CPart::gViewAsFrameToken);
- virtual ~FW_CPresentation();
-
- //----------------------------------------------------------------------------------------
- // New API
- //
- public:
- // ----- Invalidate/Validate -----
- void Invalidate(Environment *ev, ODShape* invalidShape = NULL, ODID sequenceNumber = 0);
- void Validate(Environment *ev, ODShape* validShape = NULL, ODID sequenceNumber = 0);
-
- void Invalidate(Environment* ev, const FW_CRect& invalidRect, ODID sequenceNumber = 0);
- void Validate(Environment* ev, const FW_CRect& validRect, ODID sequenceNumber = 0);
-
- // ----- Getters -----
- FW_CSelection* GetSelection(Environment* ev) const;
- FW_CPart* GetPart(Environment* ev) const;
- ODTypeToken GetPresentationType(Environment* ev) const;
-
- unsigned long CountFrame(Environment* ev) const;
-
- void SetDefaultEmbeddedFrameViewType(Environment *ev, ODTypeToken viewType);
- ODTypeToken GetDefaultEmbeddedFrameViewType(Environment *ev) const;
-
- // ------ Frame Negotiation -----
- ODID RequestSiblingFrame(Environment* ev,
- FW_CFrame* baseFrame,
- ODShape* suggestedFrameShape,
- ODTypeToken viewType,
- FW_Boolean isOverlaid);
- void RemoveSiblingFrame(Environment* ev,
- FW_CFrame* frameToRemove);
- // ----- View In Window -----
- ODID OpenPartWindow(Environment* ev, FW_CFrame* sourceFrame, ODFacet* sourceFacet);
-
- FW_CFrame* GetPartWindowFrame(Environment* ev) const;
- FW_CWindow* GetPartWindow(Environment* ev) const;
-
- // ----- View As -----
- void UpdateViewAs(Environment* ev);
-
- // ----- Change -----
- void ContentUpdated(Environment* ev, ODUpdateID updateID = kODUnknownUpdate);
-
- // ----- ReleaseAll -----
- void ReleaseAll(Environment* ev);
-
- // ----- Focus Set -----
- ODFocusSet* GetFocusSet(Environment* ev) const;
- void SetFocusSet(Environment* ev, ODFocusSet* focusSet);
- void AdoptFocusSet(Environment* ev, ODFocusSet* focusSet);
-
- // ----- Embedding -----
- virtual void Embed(Environment* ev,
- ODPart* embeddedPart,
- ODFrame* embeddedFrame,
- ODType frameType,
- FW_MProxy* proxy,
- ODShape* frameShape,
- ODTypeToken viewType,
- ODTypeToken presentationType,
- ODID frameGroupID,
- FW_Boolean isOverlaid,
- FW_Boolean subFrame);
-
-
- //----------------------------------------------------------------------------------------
- // Internal Use Only
- //
- public:
- FW_CViewAs* PrivAcquireViewAs(Environment* ev, FW_CFrame* frame, ODTypeToken viewAs);
- void PrivReleaseViewAs(FW_CViewAs* viewAs);
-
- void PrivAddFrame(Environment *ev, FW_CFrame* frame);
- void PrivDeleteDisplayFrame(Environment *ev, FW_CPrivDisplayFrame* displayFrame);
-
- void PrivInvalidateIconedFrame(Environment *ev);
-
- FW_CPrivDisplayFrame* PrivGetDisplayFrame(FW_CFrame* frame) const;
-
- virtual FW_CFrame* PrivNewFrame(Environment *ev,
- ODFrame* odFrame,
- FW_Boolean fromStorage);
-
- // ----- Frame Removed Notification -----
- void PrivFrameRemoved(Environment *ev, FW_CFrame* frame, FW_Boolean toStorage);
-
- // ----- A drag is pending on one of the frame of this presentation -----
- FW_Boolean PrivIsDragPending() const;
- void PrivSetDragPending(FW_Boolean pending);
-
- //----------------------------------------------------------------------------------------
- // Data Members
- //
- private:
- FW_CPart* fPart;
- FW_CSelection* fSelection;
- FW_TOrderedCollection<FW_CPrivDisplayFrame>* fFrames;
- ODTypeToken fPresentationType;
- ODFocusSet* fFocusSet;
- ODArbitrator* fArbitrator;
-
- FW_CViewAs* fViewAsThumbnail;
- FW_CViewAs* fViewAsSmallIcon;
- FW_CViewAs* fViewAsLargeIcon;
-
- FW_CFrame* fPartWindowFrame;
-
- ODTypeToken fDefaultEmbeddedFrameViewType; // ViewAs of new embedded frames
- FW_Boolean fDragPending; // Use during a drag so the selecion can be flagged as in limbo
- };
-
-
- //========================================================================================
- // Inlines
- //========================================================================================
-
- //----------------------------------------------------------------------------------------
- // FW_CPresentation::GetSelection
- //----------------------------------------------------------------------------------------
- inline FW_CSelection* FW_CPresentation::GetSelection(Environment*) const
- {
- return fSelection;
- }
-
- //----------------------------------------------------------------------------------------
- // FW_CPresentation::GetSelection
- //----------------------------------------------------------------------------------------
- inline FW_CPart* FW_CPresentation::GetPart(Environment*) const
- {
- return fPart;
- }
-
- //----------------------------------------------------------------------------------------
- // FW_CPresentation::GetPresentationType
- //----------------------------------------------------------------------------------------
- inline ODTypeToken FW_CPresentation::GetPresentationType(Environment*) const
- {
- return fPresentationType;
- }
-
- //----------------------------------------------------------------------------------------
- // FW_CPresentation::GetPartWindowFrame
- //----------------------------------------------------------------------------------------
- inline FW_CFrame* FW_CPresentation::GetPartWindowFrame(Environment*) const
- {
- return fPartWindowFrame;
- }
-
- //----------------------------------------------------------------------------------------
- // FW_CPresentation::SetDefaultEmbeddedFrameViewType
- //----------------------------------------------------------------------------------------
- inline void FW_CPresentation::SetDefaultEmbeddedFrameViewType(Environment*, ODTypeToken viewType)
- {
- fDefaultEmbeddedFrameViewType = viewType;
- }
-
- //----------------------------------------------------------------------------------------
- // FW_CPresentation::GetDefaultEmbeddedFrameViewType
- //----------------------------------------------------------------------------------------
- inline ODTypeToken FW_CPresentation::GetDefaultEmbeddedFrameViewType(Environment*) const
- {
- return fDefaultEmbeddedFrameViewType;
- }
-
- //----------------------------------------------------------------------------------------
- // FW_CPresentation::GetFocusSet
- //----------------------------------------------------------------------------------------
- inline ODFocusSet* FW_CPresentation::GetFocusSet(Environment*) const
- {
- return fFocusSet;
- }
-
- //----------------------------------------------------------------------------------------
- // FW_CPresentation::PrivIsDragPending
- //----------------------------------------------------------------------------------------
- inline FW_Boolean FW_CPresentation::PrivIsDragPending() const
- {
- return fDragPending;
- }
-
- //----------------------------------------------------------------------------------------
- // FW_CPresentation::PrivSetDragPending
- //----------------------------------------------------------------------------------------
- inline void FW_CPresentation::PrivSetDragPending(FW_Boolean pending)
- {
- fDragPending = pending;
- }
-
- #endif